﻿namespace Mp3Observer.Interfaces
{
    #region usings

    using System.Collections.Generic;
    using Mp3Observer.Model;

    #endregion

    /// <summary>
    /// Contract definition for data access (xml,sql,.)
    /// </summary>
    public interface IDataAccess
    {
        /// <summary>
        /// Adds the item to the data store.
        /// </summary>
        /// <param name="item">The FileEntity.</param>
        void AddItem(FileEntity item);

        /// <summary>
        /// Closes the database connection.
        /// </summary>
        void Close();

        /// <summary>
        /// Gets all items from the datastore.
        /// </summary>
        /// <returns>list of FileEntity</returns>
        IEnumerable<FileEntity> GetAllItems();

        /// <summary>
        /// Deletes all items from the datastore.
        /// </summary>
        /// <returns>true if successful, otherwise false</returns>
        bool DeleteAllItems();

        /// <summary>
        /// Gets the albums from the datastore.
        /// </summary>
        /// <returns>list of albums</returns>
        IEnumerable<FileProperty> GetAlbums();

        /// <summary>
        /// Saves this current instance.
        /// </summary>
        void Save();

        /// <summary>
        /// Deletes the items from the datastore.
        /// </summary>
        /// <param name="items">The items to delete.</param>
        void DeleteItems(IEnumerable<FileEntity> items);

        /// <summary>
        /// Gets the next free id.(primary key)
        /// </summary>
        /// <returns>int number >= 0</returns>
        int GetNextFreeId();
    }
}
